package org.colafries.admin.entity.vo.index;

import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import org.colafries.admin.entity.vo.ColafriesBaseVO;
import org.colafries.common.enums.ColumnDataTypeEnum;
import org.colafries.common.enums.LogicFieldTypeEnum;

import java.util.List;

/**
 * @author Ann
 * @version v1.0
 * @ClassName LogicFactTblDetailReqVO
 * @Description
 * @date Created in 2024/6/5
 **/
@Data
public class LogicFactTblFieldReqVO extends ColafriesBaseVO {

    @ApiModelProperty(value = "逻辑表code", dataType = "string", required = true, example = "8486519050329444352")
    private Long logicTableCode;

    @ApiModelProperty(value = "逻辑表字段List", dataType = "List", required = true, example = "[{\"code\":\"8486933637849206784\",\"field\":\"project_no\",\"alias\":\"办件编号\",\"dataType\":\"STRING\",\"expression\":\"\",\"logicFieldType\":\"LOGIC_FACT\"}]")
    private List<LogicTableFieldVO> logicTblFieldList;

    @ApiModelProperty(value = "创建人", dataType = "string", required = true, example = "Ann")
    private String createUser;

    @ApiModelProperty(value = "修改人", dataType = "string", required = true, example = "Ann")
    private String updateUser;

    /**
     * LogicTableField
     */
    @Data
    @Builder
    public static class LogicTableFieldVO {
        @ApiModelProperty(value = "逻辑表字段code", dataType = "string", required = true, example = "8486933637849206784")
        private Long code;

        @ApiModelProperty(value = "逻辑表字段英文名", dataType = "string", required = true, example = "project_no")
        private String field;

        @ApiModelProperty(value = "逻辑表字段名称", dataType = "string", required = true, example = "办件编号")
        private String alias;

        @ApiModelProperty(value = "数据类型", dataType = "string", required = true, example = "STRING")
        private ColumnDataTypeEnum dataType;

        @ApiModelProperty(value = "计算表达式", dataType = "string", example = "xxx")
        private String expression;

        @ApiModelProperty(value = "逻辑字段类型", dataType = "string", required = true, example = "LOGIC_FACT")
        private LogicFieldTypeEnum logicFieldType;
    }
}
